<template>
  <div>
    <!-- 面包屑导航区域 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/index' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>通讯录</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card>
      <!-- 部门列表区 -->
      <el-table border stripe :data="data">
        <el-table-column label="序号" type="index"> </el-table-column>
        <el-table-column prop="jobNumber" label="工号"> </el-table-column>
        <el-table-column prop="name" label="姓名"> </el-table-column>
        <el-table-column prop="phone" label="电话"> </el-table-column>
        <el-table-column prop="department" label="部门"> </el-table-column>
      </el-table>
      <!-- 通讯录条数 -->
      <!-- <el-pagination layout="total" :total="total"> </el-pagination> -->
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      data: [],
      total: 0,
    };
  },
  created() {
    this.phone();
  },
  methods: {
    phone() {
      this.$http.get("employee/getPhone").then((res) => {
        console.log(res);
        this.data = res.data.data;
        // this.total = res.data.total;
        if (res.data.flag == true) {
          return this.$message.success("查询通讯录信息成功!");
        }
        if (res.data.flag !== true) {
          return this.$message.error("查询通讯录信息失败!");
        }
      });
    },
  },
};
</script>

<style scoped></style>
